package org.linlinjava.litemall.db.service;

import com.github.pagehelper.PageHelper;
import org.linlinjava.litemall.db.dao.LemonlaCategoryMapper;
import org.linlinjava.litemall.db.dao.LitemallCategoryMapper;
import org.linlinjava.litemall.db.domain.LemonlaCategory;
import org.linlinjava.litemall.db.domain.LemonlaCategoryExample;
import org.linlinjava.litemall.db.domain.LitemallCategory;
import org.linlinjava.litemall.db.domain.LitemallCategoryExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LemonlaCategoryService {
    @Resource
    private LemonlaCategoryMapper categoryMapper;

    public List<LemonlaCategory> queryL1(int offset, int limit) {
        LemonlaCategoryExample example = new LemonlaCategoryExample();
        example.or().andLevelEqualTo("L1").andDeletedEqualTo(false);
        PageHelper.startPage(offset, limit);
        return categoryMapper.selectByExample(example);
    }
}
